fe963a36a326225a2cffa11edea52495a972a3fc,ecj/ec/gp/koza/KozaNodeSelector.java,KozaNodeSelector,pickNode,#EvolutionState#number#number#GPIndividual#GPTree#,168

Before Change


                nonterminals = tree.child.numNodes(GPNode.NODESEARCH_NONTERMINALS);
            if (nonterminals > 0) // there are some nonterminals
                {
                tree.child.nodeInPosition(s.random[thread].nextInt(nonterminals),
                    gatherer,
                    GPNode.NODESEARCH_NONTERMINALS);
                return gatherer.node;
                }
            else // there ARE no nonterminals!  It must be the root node

After Change


            if (nonterminals==-1) nonterminals = tree.child.numNodes(GPNode.NODESEARCH_NONTERMINALS);
            if (nonterminals > 0) // there are some nonterminals
                {
                return tree.child.nodeInPosition(s.random[thread].nextInt(nonterminals), GPNode.NODESEARCH_NONTERMINALS);
                }
            else // there ARE no nonterminals!  It must be the root node
                {